package painter4ViewHelper;

import java.awt.Graphics;
import java.awt.Image;
import java.util.ArrayList;

import model.Position;

public class Painter {
	
	private Position position;
	private ArrayList<Image> images;	
	
	public Painter(Position position, ArrayList<Image> images) {
		super();
		this.position = position;
		this.images = images;
	}

	public Painter(int x, int y, ArrayList<Image> images) {
		super();
		this.position = new Position(x,y);
		this.images = images;
	}
	
	public void moveTo(Position pos) {
		position.moveTo(pos);
	}
	
	public void moveTo(Position pos,int speed) {
		position.moveTo(pos,speed);
	}
	
	public Image getImage() {
		return getImage(0);
	}
	
	public Image getImage(int index) {
		return images.get(index % images.size());
	}

	public void paint(Graphics g) {
		g.drawImage(getImage(),position.getX(),position.getY(), null);	
	}
	public Position getPosition() {
		return position;
	}
	
}
